package com.sdleyou.treepro.business.api.tree;

import com.sdleyou.treepro.common.model.utils.ResultVOUtil;
import com.sdleyou.treepro.common.model.vo.ResultVO;
import com.sdleyou.treepro.common.service.TreeManager;
import com.sdleyou.treepro.system.version.ApiVersion;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api")
public class TreeController {
    @Autowired
    private TreeManager treeManager;

    @ApiVersion(1)
    @GetMapping("/{version}/trees")
    public ResultVO treeList() {
        return ResultVOUtil.success(treeManager.treeList());
    }
}
